package com.ctgu.computer.controller.topic;

import com.ctgu.computer.domain.dto.NoticePageDTO;
import com.ctgu.computer.domain.dto.PageQueryDTO;
import com.ctgu.computer.domain.result.PageResult;
import com.ctgu.computer.domain.result.Result;
import com.ctgu.computer.service.DocumentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/sys/document")
@RequiredArgsConstructor
@Tag(name = "主页文件相关接口")
public class DocumentController {
        private final DocumentService documentService;

    @Operation(summary = "分页查询所有文件")
    @PostMapping("/page")
    public Result<PageResult> page(@RequestBody PageQueryDTO pageQueryDTO){
        PageResult pageResult = documentService.page(pageQueryDTO);
        System.out.println("分页查询文件"+pageResult);
        return Result.success(pageResult);
    }
}
